@keyframes carbon-placeholder-animation {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.ads-via-carbon-space {
  margin-top: 20px;
  min-height: 100px;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #f5f5f5 0%, #e8e8e8 50%, #f5f5f5 100%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: carbon-placeholder-animation 1.5s infinite linear;

    .rs-theme-dark &,
    .rs-theme-high-contrast & {
      background: linear-gradient(90deg, #333 0%, #222 50%, #333 100%);
    }
  }

  #carbonads {
    position: absolute;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu,
      Cantarell, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    box-shadow: var(--rs-shadow-md);
    background: var(--rs-card-bg);
    overflow: hidden;
    border-radius: 4px;

    * {
      margin: initial;
      padding: initial;
    }

    a {
      color: inherit;
      text-decoration: none;
      &:hover {
        color: inherit;
      }
    }

    span {
      position: relative;
      display: block;
      overflow: hidden;
    }

    .carbon-wrap {
      display: flex;
    }

    .carbon-img {
      display: block;
      margin: 0;
      line-height: 1;

      img {
        display: block;
      }
    }

    .carbon-text {
      font-size: 13px;
      padding: 10px;
      margin-bottom: 16px;
      line-height: 1.5;
      text-align: left;
    }

    .carbon-poweredby {
      display: block;
      padding: 6px 8px;
      text-align: center;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      font-weight: 600;
      font-size: 8px;
      line-height: 1;
      border-top-left-radius: 3px;
      position: absolute;
      bottom: 0;
      right: 0;
    }
  }
}
